Roguelike Universe - Link Generation

We can generate the inspiration network based on our data.


In [607]:
import os
import io
import json
import pandas as pd

def read_json(path):
    data = ''
    with io.open(path, 'r', encoding='utf-8') as f:
        data = json.loads(f.read())
#         print(__message('Loaded {}'.format(path)))
    return data
    
def save_json(path, data):
    with io.open(path, 'w', encoding='utf-8') as f:
        try:
            output = json.dumps(data, indent=2, ensure_ascii=False)
            f.write(output)
        except UnicodeEncodeError:
            f.write(output.encode('utf-8'))
#     print(__message('Written to {}'.format(path)))
    
def __success(text):
    return '  (SUCC) {}'.format(text).encode('utf-8')
    
def __failure(text):
    return '!!FAIL!! {}'.format(text).encode('utf-8')
    
def __warning(text):
    return '??WARN?? {}'.format(text).encode('utf-8')
    
def __message(text):
    return '   |MSG| {}'.format(text).encode('utf-8')

RogueTemple Influences

The data already comes with existing influences documented by the community.

We also load the collected corpus.


In [608]:
roguelikes = pd.read_csv(os.path.join(os.getcwd(), 'roguelikes.csv'), skip_blank_lines=True)
roguelike_names = set(x for x in roguelikes['Name'] if isinstance(x, str))

roguelikelikes = pd.read_csv(os.path.join(os.getcwd(), 'roguelike-likes.csv'), skip_blank_lines=True)
roguelikelike_names = set(x for x in roguelikelikes['Name'] if isinstance(x, str))

roguelike_corpus = read_json('corpus.json')
roguelikelike_corpus = read_json('corpus-roguelike-like.json')

RogueTemple Influences


In [609]:
import datetime

roguelike_universe_data = roguelikes.copy(deep=True)
roguelike_universe_data.set_index('Name')

for i, roguelike in roguelike_universe_data.iterrows():
    title = roguelike['Name']
    influences = roguelike['Influences']
    
    if not isinstance(title, str):
        continue
        
    if isinstance(influences, str):
        roguelike['Influences'] = [x.strip() for x in influences.split(',')]
    else:
        roguelike['Influences'] = []
        
    if isinstance(roguelike['Released'], str):
        year, month, day = (int(x) for x in roguelike['Released'].split('/'))
        if year == 1000:
            roguelike['Released'] = None
        else:
            try:
                roguelike['Released'] = datetime.date(year, month, day)
            except:
                try:
                    roguelike['Released'] = datetime.date(year, 1, 1)
                except:
                    roguelike['Released'] = None
        
    if isinstance(roguelike['Updated'], str):
        if year == 1000:
            roguelike['Updated'] = None
        else:
            try:
                roguelike['Updated'] = datetime.date(year, month, day)
            except:
                try:
                    roguelike['Updated'] = datetime.date(year, 1, 1)
                except:
                    roguelike['Updated'] = None
        
# sample of influences
roguelike_universe_data.head(10)


Out[609]:
Name RogueTemple Link Status Released Updated Developer Theme Influences
0 100 Heroes: Shopkeeper of Doom http://roguebasin.roguelikedevelopment.org/ind... http://www.bay12forums.com/smf/index.php?topic... alpha 2012-01-01 2012-01-01 Paul Wright Economics/Trading [Recettear]
1 100 Rogues http://roguebasin.roguelikedevelopment.org/ind... http://www.100rogues.com/ stable 2010-05-06 2010-05-06 Dinofarm Games Fantasy [Rogue]
2 1Quest http://roguebasin.roguelikedevelopment.org/ind... http://www.ratzngodz.fr/ stable 2014-02-20 2014-02-20 Ratz 'N' Godz Fantasy [Dungeon Crawl Stone Soup, Dominion4]
3 3059 http://roguebasin.roguelikedevelopment.org/ind... https://sites.google.com/site/free3069/3059---... stable 2005-01-01 2005-01-01 Phr00t Science Fiction, Alien Planets, Futuristic [NetHack]
4 3069 http://roguebasin.roguelikedevelopment.org/ind... http://sites.google.com/site/free3069/ stable 2009-07-06 2009-07-06 Phr00t Science Fiction, Alien Planets, Futuristic [3059]
5 3079 http://roguebasin.roguelikedevelopment.org/ind... http://sites.google.com/site/3079game/ stable 2011-10-25 2011-10-25 Phr00t Science Fiction, Alien Planets, Futuristic [3059, 3069, Fallout, Minecraft]
6 3089 http://roguebasin.roguelikedevelopment.org/ind... http://3089game.wordpress.com/ stable 2013-02-02 2013-02-02 Phr00t Science Fiction, Alien Planets, Futuristic [3059, 3069, 3079, Borderlands]
7 7KBRLL http://roguebasin.roguelikedevelopment.org/ind... https://sites.google.com/site/7kbrll stable 2014-07-11 2014-07-11 OMVTW humor, psychological [NetHack, Rogue]
8 91 http://roguebasin.roguelikedevelopment.org/ind... http://startcontinue.com/ beta None None Greg Smith Modern []
9 @Star Wars http://roguebasin.roguelikedevelopment.org/ind... http://www.caffeineoverdose.me/ alpha 2012-01-01 2012-01-01 Andrew Wright (aka roocey) Science Fiction, Space [Crawl]

Keyword spotting: matching mentions of other games


In [610]:
not_games = set([
    'Steam',
    'Infinite Space', # Not related to the roguelike game here
    'There',
    'Android',
    'Androids',
    'Combat',
    'How',
    'Core',
    'Add',
    'Monsters',
    'Ghosts',
    'Epic',
    'Adventure', # Usually referred to as Colossal Cave Adventure
    'Contact',
    'Change',
    'Corruption',
    'Ancient Domains of Mystery', # Already covered in other places
    'Dungeons',
    'One',
    'Meanwhile',
    'Barbarian',
    'Shift',
    'Which',
    'Creatures',
    'Dollar',
    'Underground',
    'Curses',
    'Air',
    'Trader',
    'Files',
    'Space',
    'Go',
    'Bonus',
    'Ogre',
    'Legendary',
    'Tower',
    'Wizard',
    'January',
    'Fantasy',
    'Deep',
    'Assault',
    'Alchemist',
    'Speed',
    'File',
    'Elf',
    'Plot',
    'Chaos',
    'Warlord',
    'Where',
    'Chrome',
    'Dexterity',
    'Blood',
    'White',
    'Charly',
    'Scout',
    'Berserk',
    'Clans',
    'Heretic',
    'Dungeon',
    'Satyr',
    'Spider',
    'Lair',
    'Break',
    'AWOL',
    'Create',
    'Campaign',
    'Music',
    'Pop',
    'Falcon',
    'Escape',
    'Elves',
    'Fred',
    'Life',
    'Joshua',
    'Up',
    'ER',
    'Ki',
    'VC',
    'Veteran',
    'People',
    'Columns',
    'Explore',
    'Town',
    'Attack',
    'Firefox',
    'Grow',
    'Search',
    'Satan',
    'Time',
    'Pacific',
    'Black',
    'Love',
    'Race',
    'Silver',
    'Henry',
])

In [611]:
import re
from collections import Counter

roguelike_influence = []
roguelikelike_influence = []
other_influence = []

for i, roguelike in enumerate(roguelike_corpus):
    roguelike_things = Counter()
    roguelikelike_things = Counter()
    other_things = Counter()
    things = []
    
    if isinstance(roguelike['title'], str):
        for webpage in roguelike['text']:
            for paragraph in webpage.split('\n\n'):
                if not paragraph.strip():
                    continue

                current = ''
                for token in re.split('\W', paragraph):
                    if      len(token) > 1 and \
                            re.compile("^[A-Z0-9][\w:']*[\w:']|[A-Z\.]+$").match(token) or \
                            (current and token in ('the', 'of', 'no', 'to')):
                        current += '{} '.format(token)
                    elif current:
                        things.append(current.strip())
                        current = ''

        for x in things:
            if x in roguelike_names and x != roguelike['title'] and len(x) > 2 and x != 'Choose':
                roguelike_things[x] += 1
            elif x in roguelikelike_names and x != roguelike['title'] and len(x) > 2:
                roguelikelike_things[x] += 1
            elif x in video_game_names and x != roguelike['title'] and x not in not_games and len(x) > 2:
                other_things[x] += 1  
            
    roguelike_influence.append({
        "title": roguelike['title'],
        "influences": roguelike_things
    })
    
    roguelikelike_influence.append({
        "title": roguelike['title'],
        "influences": roguelikelike_things
    })
    
    other_influence.append({
        "title": roguelike['title'],
        "influences": other_things
    })
    
ri = [[y[0] for y in x["influences"].most_common(5)] for x in roguelike_influence]
rli = [[y[0] for y in x["influences"].most_common(5)] for x in roguelikelike_influence]
oi = [[y[0] for y in x["influences"].most_common(5)] for x in other_influence]

roguelike_universe_data["Inferred_Roguelike_Influences"] = ri
roguelike_universe_data["Inferred_Roguelikelike_Influences"] = rli
roguelike_universe_data["Inferred_Other_Influences"] = oi

roguelike_universe_data


Out[611]:
Name RogueTemple Link Status Released Updated Developer Theme Influences Inferred_Roguelike_Influences Inferred_Roguelikelike_Influences Inferred_Other_Influences
0 100 Heroes: Shopkeeper of Doom http://roguebasin.roguelikedevelopment.org/ind... http://www.bay12forums.com/smf/index.php?topic... alpha 2012-01-01 2012-01-01 Paul Wright Economics/Trading [Recettear] [] [] []
1 100 Rogues http://roguebasin.roguelikedevelopment.org/ind... http://www.100rogues.com/ stable 2010-05-06 2010-05-06 Dinofarm Games Fantasy [Rogue] [Rogue, Cardinal Quest, The Dungeon, Sword of ... [Diablo] [Persona, Tetris, Galaga, Star Wars, The Masqu...
2 1Quest http://roguebasin.roguelikedevelopment.org/ind... http://www.ratzngodz.fr/ stable 2014-02-20 2014-02-20 Ratz 'N' Godz Fantasy [Dungeon Crawl Stone Soup, Dominion4] [Clarion] [] [Post Mortem, Hotel, Suspect, Knock, Quest of ...
3 3059 http://roguebasin.roguelikedevelopment.org/ind... https://sites.google.com/site/free3069/3059---... stable 2005-01-01 2005-01-01 Phr00t Science Fiction, Alien Planets, Futuristic [NetHack] [3079, 3089, 3069, Sword of Fargoal, Rogue] [] [Phantom Crash, HeroQuest, Wizardry, Minecraft...
4 3069 http://roguebasin.roguelikedevelopment.org/ind... http://sites.google.com/site/free3069/ stable 2009-07-06 2009-07-06 Phr00t Science Fiction, Alien Planets, Futuristic [3059] [3089, 3059, 3079, Sword of Fargoal, Decker] [] [Image, Descent, HeroQuest, Animal, Battle of ...
5 3079 http://roguebasin.roguelikedevelopment.org/ind... http://sites.google.com/site/3079game/ stable 2011-10-25 2011-10-25 Phr00t Science Fiction, Alien Planets, Futuristic [3059, 3069, Fallout, Minecraft] [3089, 3059, 3069] [] [Minecraft, Gentrieve, Fallout, Deus Ex, Borde...
6 3089 http://roguebasin.roguelikedevelopment.org/ind... http://3089game.wordpress.com/ stable 2013-02-02 2013-02-02 Phr00t Science Fiction, Alien Planets, Futuristic [3059, 3069, 3079, Borderlands] [3079, 3059, 3069] [] [Overlord]
7 7KBRLL http://roguebasin.roguelikedevelopment.org/ind... https://sites.google.com/site/7kbrll stable 2014-07-11 2014-07-11 OMVTW humor, psychological [NetHack, Rogue] [NetHack] [] []
8 91 http://roguebasin.roguelikedevelopment.org/ind... http://startcontinue.com/ beta None None Greg Smith Modern [] [] [] []
9 @Star Wars http://roguebasin.roguelikedevelopment.org/ind... http://www.caffeineoverdose.me/ alpha 2012-01-01 2012-01-01 Andrew Wright (aka roocey) Science Fiction, Space [Crawl] [] [] [Star Wars, Crawl, Balance]
10 ADOM http://roguebasin.roguelikedevelopment.org/ind... http://www.adom.de/ major 1994-01-01 1994-01-01 Thomas Biskup Fantasy [Hack] [ADOM II, Rogue, Angband, Hack] [] [Caverns of Chaos, Fireball, Fate, Druid, Fall...
11 ADOM II http://roguebasin.roguelikedevelopment.org/ind... http://www.ancientdomainsofmystery.com/ beta 2011-01-01 2011-01-01 Thomas Biskup Fantasy [ADOM] [ADOM, Rogue, Brogue, Angband] [Spelunky] [Fireball, Fate, Caverns of Chaos, Call of Dut...
12 AGB Hack http://roguebasin.roguelikedevelopment.org/ind... http://www.freewebs.com/drussell/#GBA stable 2006-11-26 2006-11-26 Donnie Russell NaN [] [NetHack, Hack, AGB Rogue] [] []
13 AGB Rogue http://roguebasin.roguelikedevelopment.org/ind... http://www.freewebs.com/drussell/Download.htm stable 2007-01-01 2007-01-01 Donnie Russell Fantasy [] [Rogue, NetHack, Angband, ClassicRogue, Hack] [Diablo] [Pokemon, Dragon Warrior Monsters, Shining Sou...
14 AMoria http://roguebasin.roguelikedevelopment.org/ind... https://forums.roguetemple.com/irldb/index.php... stable None None NaN NaN [Moria] [] [] [MapleStory, Party Quest, Las Vegas, The Secre...
15 A False Saint, An Honest Rogue http://roguebasin.roguelikedevelopment.org/ind... http://humbit.com/rogue alpha 2013-03-16 2013-03-16 Jeremiah Reid Wilderness Survival [] [] [The Binding of Isaac] [The House, Super Hexagon, Hoplite]
16 Adeo http://roguebasin.roguelikedevelopment.org/ind... http://adeo.pfhoenix.com/ alpha 2006-01-01 2006-01-01 Pfhoenix Science Fiction [Escape Velocity, Fallout, Angband] [] [] [Phoenix, Space HoRSE, Total Eclipse, Air Assa...
17 Advanced Rogue http://roguebasin.roguelikedevelopment.org/ind... http://rogue.rogueforge.net/ stable 2005-01-01 2005-01-01 Michael Morgan, Ken Dalka, Roguelike Restorati... NaN [Rogue, Super-Rogue] [Rogue, UltraRogue, XRogue, LinuxRogue, Rogue ... [] [Amazon, Stealth, Diplomacy, Reflex, Elemental...
18 Agduria http://roguebasin.roguelikedevelopment.org/ind... http://koti.mbnet.fi/paulkp/agduria/index.htm alpha 2009-01-01 2009-01-01 Paul Pekkarinen Fantasy [NetHack] [] [] []
19 Albion http://roguebasin.roguelikedevelopment.org/ind... http://www.triangularpixels.com/games/albion/ alpha 2010-01-24 2010-01-24 OrangyTang Medieval Fantasy [Exile, Shining Force] [] [] [Max, Forest, The Masquerade, Vampire, Star Wars]
20 AliensRL http://roguebasin.roguelikedevelopment.org/ind... http://alien.chaosforge.org/ beta 2007-03-18 2007-03-18 Kornel Kisielewicz Horror, Science Fiction [Aliens (movie), Alien Breed: Tower Assault] [] [] [Aliens, Alien Breed]
21 Allure of the Stars http://roguebasin.roguelikedevelopment.org/ind... http://allureofthestars.com/ beta 2011-08-05 2011-08-05 Andres Löh, Mikolaj Konarski near-future Sci-Fi [Angband, X-Com] [Angband] [] []
22 AloneRL http://roguebasin.roguelikedevelopment.org/ind... https://github.com/fabioticconi/alone-rl alpha 2017-01-01 2017-01-01 Fabio Ticconi Survival, Simulation [UnReal World, Wayward] [UnReal World, Wayward] [] [Survival]
23 Alphaman http://roguebasin.roguelikedevelopment.org/ind... https://forums.roguetemple.com/irldb/there%20i... stable 1995-01-01 1995-01-01 Jeffrey R. Olson Post-Apocalyptic [] [Larn] [] [Fallout, AlphaMan]
24 Ananias http://roguebasin.roguelikedevelopment.org/ind... http://ananiasgame.com/ stable 2014-05-14 2014-05-14 Slash Fantasy [DoomRL] [Slayer] [] []
25 Angband http://roguebasin.roguelikedevelopment.org/ind... http://rephial.org/ major 1990-01-01 1990-01-01 Alex Cutler, Andy Astrand, many others. Angban... Fantasy [Moria, Rolemaster] [Oangband, ToME, Hack, Rogue] [] [Moria]
26 Animeband http://roguebasin.roguelikedevelopment.org/ind... http://angband.oook.cz/animeband/ stable 2003-05-23 2003-05-23 Ernest Huang (''animeband''@''oook.cz'') Fantasy/Anime [Angband] [Angband] [] [Final Fantasy]
27 Anoxic Depths http://roguebasin.roguelikedevelopment.org/ind... http://roguelikeeducation.org/20.html stable 2015-03-15 2015-03-15 Tectorum Wilderness Survival, Underwater, SCUBA [Kunoichi, EmoSquid] [Kunoichi] [] []
28 Anoxic Depths: Caves of the Yendori http://roguebasin.roguelikedevelopment.org/ind... http://studiotectorum.com/anoxic-depths/ stable 2015-06-03 2015-06-03 Studio Tectorum (Tectorum) Underwater, SCUBA [Anoxic Depths] [Anoxic Depths] [] []
29 Aquarium Arena http://roguebasin.roguelikedevelopment.org/ind... https://github.com/valrak/AquariumRL alpha 2016-01-01 2016-01-01 valrak Underwater [] [] [Diablo III] [Aquarium, Guild Wars, Batman, Titanfall, Storm]
... ... ... ... ... ... ... ... ... ... ... ... ...
572 Witchaven the Roguelike http://roguebasin.roguelikedevelopment.org/ind... http://asciirealm.blogspot.com.es/ beta 2012-01-01 2012-01-01 Alberto Sáez (Ubermann) Fantasy [NetHack, Rogue, Witchaven] [Rogue, Emergence, XRogue, LinuxRogue, Rogue C... [] [EverQuest, Witchaven, Game of Thrones, Mind, ...
573 Witherwyn http://roguebasin.roguelikedevelopment.org/ind... http://www.shedletsky.com/witherwyn/ alpha 2005-08-20 2005-08-20 John Shedletsky Fantasy [] [Clarion, Castle of the Winds] [] [Post Mortem, Mars, Syberia, Myst, Hotel]
574 Wizard's Quest http://roguebasin.roguelikedevelopment.org/ind... http://wq.rlgclub.ru/index_eng.html beta 2010-02-04 2010-02-04 NaN Fantasy [] [Rodney, Tower, Hundred, Guild] [] [Green, Journey, Fallout, Power, Africa]
575 World of Tey http://roguebasin.roguelikedevelopment.org/ind... http://www.forgottenplanet.com/caillan/tey/ind... alpha 2011-01-01 2011-01-01 Pteriforever Original Fantasy [XirrelaiRPG, ToME] [XirrelaiRPG, ToME, Guild] [] [History of the World, World of Warcraft, Prim...
576 X@COM http://roguebasin.roguelikedevelopment.org/ind... http://xcomrl.blogspot.com/ alpha 2011-01-01 2011-01-01 Kyzrati Science Fiction [X-Com] [Cogmind, GearHead, Cataclysm, Brogue, Sanctuary] [] [Dwarf Fortress, ZZT, UFO, Area 51, Alpha]
577 XAngband http://roguebasin.roguelikedevelopment.org/ind... http://xangband.sourceforge.jp/eng/ stable 2003-04-03 2003-04-03 iks Fantasy [ZAngband] [ZAngband, Angband] [] [Post Mortem, Fusion, Mars, Syberia, Still Life]
578 XLarn http://roguebasin.roguelikedevelopment.org/ind... http://swinfjord-games.com/LarnII-us.html stable 2015-05-25 2015-05-25 Swinfjord-Games Fantasy [Larn] [Cogmind, Larn, NetHack, Tangledeep] [Diablo] [Fusion, Post Mortem, Syberia, Rust, Circle of...
579 XRogue http://roguebasin.roguelikedevelopment.org/ind... http://rogue.rogueforge.net/xrogue-8-0/ stable 2000-01-01 2000-01-01 Robert Pietkivitch, Roguelike Restoration Proj... NaN [Super-Rogue, Advanced Rogue] [Rogue, Advanced Rogue, LinuxRogue, Rogue Clon... [] [MAG, Spot, Pokemon, Turbo, IVAN]
580 Xenocide http://roguebasin.roguelikedevelopment.org/ind... http://xeno.chaosforge.org/ beta 2002-01-01 2002-01-01 Jakub Debski Science Fiction, Horror [] [Clarion] [Diablo] [Post Mortem, Fallout, Syberia, Neverwinter Ni...
581 Xenomarine http://roguebasin.roguelikedevelopment.org/ind... http://www.ascifiroguelike.com/ alpha 2016-01-05 2016-01-05 Logophil Science Fiction, Futuristic [Angband] [Clarion, Angband, Rogue] [] [Post Mortem, Alpha, Reus, Still Life, Syberia]
582 Xenomorph 7drl of Infinite Underworld http://roguebasin.roguelikedevelopment.org/ind... https://coolai.itch.io/xenomorph-7drl stable 2018-03-11 2018-03-11 Anohin Denis Fantasy [Demon Tactic, Gruesome] [Demon Tactic, Pixel Dungeon] [] [Xenomorph]
583 XirrelaiRPG http://roguebasin.roguelikedevelopment.org/ind... http://forgottenplanet.com/caillan/xirrelairpg... stable 2011-01-26 2011-01-26 Pteriforever DNDish Stock Fantasy [SLASH'EM, ToME, Merlin's Revenge 2] [Clarion] [Diablo] [Post Mortem, Assassin, Syberia, Rust, Hotel]
584 Yet Another Duel Simulator http://roguebasin.roguelikedevelopment.org/ind... http://www.zaimoni.com/zaiband/yads.htm alpha 2008-03-30 2008-03-30 Bessarion NaN [Angband, Crawl] [Angband] [] [Duel, Star Wars, Game of Thrones, Duels, Viper]
585 Yarl http://roguebasin.roguelikedevelopment.org/ind... http://lunicsoftware.com.au/yarl.7z%20(downloa... alpha 2008-07-27 2008-07-27 john Palmer NaN [DoomRL, Oblivion] [Clarion] [] [Post Mortem, Mars, Still Life, Syberia, Hotel]
586 Yin-Yangband http://roguebasin.roguelikedevelopment.org/ind... http://www.angband.pwp.blueyonder.co.uk/ying.html stable None None Dag Arneson Fantasy [Angband] [Angband] [Diablo] [Balance, Light, Fish, Sex, Eternity]
587 Yodanji http://roguebasin.roguelikedevelopment.org/ind... http://www.kemco.jp/sp/games/yodanji/en/index.... stable 2017-01-01 2017-01-01 Kemco Yokai [] [] [] [Post Mortem, Switch, Circle of Blood, Saints ...
588 Z+Angband http://roguebasin.roguelikedevelopment.org/ind... http://mangojuice75.googlepages.com/home beta 2008-07-12 2008-07-12 Mangojuice Fantasy/Zelazny/Cthulu [ZAngband] [Angband, ZAngband, Guild] [] [Illusion, Castles, Thief, Sorcery]
589 Zaiband http://roguebasin.roguelikedevelopment.org/ind... http://www.zaimoni.com/zaiband/index.htm alpha 2007-03-04 2007-03-04 Bessarion fantasy [Moria] [Angband, Clarion] [Diablo] [Post Mortem, Journey, Syberia, Hotel, Suspect]
590 ZAngband http://roguebasin.roguelikedevelopment.org/ind... http://www.zangband.org/ major 1994-01-01 1994-01-01 Topi Ylinen Fantasy [Angband] [Angband, Tales of Middle Earth, Oangband, Rog... [Diablo] [Moria, The Legend of Zelda, Edge, Grand Theft...
591 ZapM http://roguebasin.roguelikedevelopment.org/ind... http://www.zapm.org/ beta 2003-05-30 2003-05-30 Cyrus Dolph Science Fiction [NetHack] [NetHack, PRIME, Tower] [] [Post Mortem, Mars, Cyrus, Syberia, Energy]
592 Zerogue http://roguebasin.roguelikedevelopment.org/ind... http://sourceforge.net/projects/zerogue/ beta 2011-10-06 2011-10-06 Pasha Paterson Fantasy [LinuxRogue] [LinuxRogue, Clarion, Rogue] [] [Post Mortem, Still Life, Syberia, Carmageddon...
593 ZigClimb http://roguebasin.roguelikedevelopment.org/ind... http://flend.net/ stable 2010-01-10 2010-01-10 flend Egypt [] [Clarion, Ascension] [] [Post Mortem, Cloud, Still Life, Syberia, Rust]
594 Zomband http://roguebasin.roguelikedevelopment.org/ind... http://www.zooptek.net/drupal/?q=node/15 stable 2007-03-31 2007-03-31 ZoopTEK Zombies [Angband] [Angband] [] []
595 Zombie Minefield Sweeper http://roguebasin.roguelikedevelopment.org/ind... http://jsfiddle.net/JesterBLUE/cco8mt0a/embedd... beta 2015-01-14 2015-01-14 JesterBLUE Zombie Apocalypse [Relentless Logic, NetHack] [] [] [Relentless Logic]
596 Zombie Rogue http://roguebasin.roguelikedevelopment.org/ind... https://gamefish.itch.io/ stable 2018-03-16 2018-03-16 Game Fish Zombie [Cardinal Quest, Pixel Dungeon] [Cardinal Quest, Gone Rogue, Pixel Dungeon, Du... [] []
597 Zombies! http://roguebasin.roguelikedevelopment.org/ind... http://www.bay12forums.com/smf/index.php?topic... beta 2012-06-11 2012-06-11 Tuplis Zombie [] [] [] [Zombies, Survival, Wings, Toys, Load]
598 Zomia http://roguebasin.roguelikedevelopment.org/ind... https://github.com/globalcitizen/zomia beta None None globalcitizen Ancient history / fantasy [Angband, Brogue, Dwarf Fortress, The Land] [Brogue, Clarion, Angband] [Diablo] [Post Mortem, Carmageddon, Game of Thrones, St...
599 Zone http://roguebasin.roguelikedevelopment.org/ind... http://zonedev.tumblr.com/ stable 2012-04-15 2012-04-15 Quarry Zombie Apocalypse [] [Clarion] [] [Post Mortem, Still Life, Syberia, Exodus, Myst]
600 Zot Defense http://roguebasin.roguelikedevelopment.org/ind... http://sites.google.com/site/crawlvariations/ alpha 2009-04-10 2009-04-10 NaN Fantasy [Dungeon Crawl Stone Soup] [Dungeon Crawl Stone Soup] [] [Max, Game of Thrones, Astro Boy, Neverwinter ...
601 Zurvivors http://roguebasin.roguelikedevelopment.org/ind... http://humbit.com/dumuzid alpha 2017-03-12 2017-03-12 Jeremiah Reid zombies [] [Clarion, Golden Krone Hotel] [Diablo] [Post Mortem, Fusion, Still Life, Syberia, Hotel]

602 rows × 12 columns


In [612]:
import math

roguelikelike_universe_data = roguelikelikes.copy(deep=True)
roguelikelike_universe_data.set_index('Name')
roguelikelike_universe_data['Released'] = roguelikelike_universe_data['Released'].astype(datetime.date)
roguelikelike_universe_data['Updated'] = roguelikelike_universe_data['Updated'].astype(datetime.date)
roguelikelike_universe_data['Influences'] = roguelikelike_universe_data['Influences'].astype(list)

for i, roguelike in roguelikelike_universe_data.iterrows():
    title = roguelike['Name']
    influences = roguelike['Influences']
    
    if not isinstance(title, str):
        continue
        
    if isinstance(influences, str):
        roguelike['Influences'] = [x.strip() for x in influences.split(',')]
    else:
        roguelike['Influences'] = []
        
    if not math.isnan(roguelike['Released']):
        roguelike['Released'] = datetime.date(int(roguelike['Released']), 1, 1)
        
    if not math.isnan(roguelike['Updated']):
        roguelike['Updated'] = datetime.date(int(roguelike['Updated']), 1, 1)
        
# sample of influences
roguelikelike_universe_data.head(10)


Out[612]:
Name Released Updated Developer Theme Influences
0 ToeJam & Earl 1991-01-01 NaN Johnson Voorsanger Productions Fantasy []
1 Diablo 1996-01-01 NaN Blizzard North Fantasy []
2 Diablo II 2000-01-01 NaN Blizzard Entertainment Fantasy []
3 Strange Adventures In Infinite Space 2002-01-01 2004-01-01 Rich Carlson, Iikka Keränen Space science fiction []
4 Weird Worlds: Return to Infinite Space 2005-01-01 2014-01-01 Rich Carlson, Iikka Keränen Space science fiction []
5 Spelunky 2009-01-01 2012-01-01 Derek Yu, Andy Hull Fantasy []
6 The Binding of Isaac 2011-01-01 NaN Edmund McMillen, Florian Himsl Surrealistic, horror []
7 FTL: Faster Than Light 2012-01-01 NaN Subset Games Space science fiction []
8 Diablo III 2012-01-01 NaN Blizzard Entertainment Fantasy []
9 Don't Starve 2013-01-01 NaN Klei Entertainment Fantasy []

In [613]:
import re
from collections import Counter

roguelike_influence = []
roguelikelike_influence = []
other_influence = []

for i, roguelike in enumerate(roguelikelike_corpus):
    roguelike_things = Counter()
    roguelikelike_things = Counter()
    other_things = Counter()
    things = []
    
    if isinstance(roguelike['title'], str):
        for webpage in roguelike['text']:
            for paragraph in webpage.split('\n\n'):
                if not paragraph.strip():
                    continue

                current = ''
                for token in re.split('\W', paragraph):
                    if      len(token) > 1 and \
                            re.compile("^[A-Z0-9][\w:']*[\w:']|[A-Z\.]+$").match(token) or \
                            (current and token in ('the', 'of', 'no', 'to')):
                        current += '{} '.format(token)
                    elif current:
                        things.append(current.strip())
                        current = ''

        for x in things:
            if x in roguelike_names and x != roguelike['title'] and x != 'Choose':
                roguelike_things[x] += 1
            elif x in roguelikelike_names and x != roguelike['title']:
                roguelikelike_things[x] += 1
            elif x in video_game_names and x != roguelike['title'] and x not in not_games:
                other_things[x] += 1  
            
    roguelike_influence.append({
        "title": roguelike['title'],
        "influences": roguelike_things
    })
    
    roguelikelike_influence.append({
        "title": roguelike['title'],
        "influences": roguelikelike_things
    })
    
    other_influence.append({
        "title": roguelike['title'],
        "influences": other_things
    })
    
ri = [[y[0] for y in x["influences"].most_common(5)] for x in roguelike_influence]
rli = [[y[0] for y in x["influences"].most_common(5)] for x in roguelikelike_influence]
oi = [[y[0] for y in x["influences"].most_common(5)] for x in other_influence]

roguelikelike_universe_data["Inferred_Roguelike_Influences"] = ri
roguelikelike_universe_data["Inferred_Roguelikelike_Influences"] = rli
roguelikelike_universe_data["Inferred_Other_Influences"] = oi
roguelikelike_universe_data.head(10)


Out[613]:
Name Released Updated Developer Theme Influences Inferred_Roguelike_Influences Inferred_Roguelikelike_Influences Inferred_Other_Influences
0 ToeJam & Earl 1991-01-01 NaN Johnson Voorsanger Productions Fantasy [] [Rogue, 91] [] [Streets of Rage, Genesis, Starflight, Sonic t...
1 Diablo 1996-01-01 NaN Blizzard North Fantasy [] [Rogue, Sanctuary, Telengard] [Diablo III, Diablo II] [Hellfire, World of Warcraft, StarCraft, Justi...
2 Diablo II 2000-01-01 NaN Blizzard Entertainment Fantasy [] [Sanctuary, Rogue, Demon, Cataclysm] [Diablo, Diablo III] [StarCraft, Baal, World of Warcraft, Paladin, ...
3 Strange Adventures In Infinite Space 2002-01-01 2004-01-01 Rich Carlson, Iikka Keränen Space science fiction [] [Rogue, NetHack] [] [Star Trek, Dragon, Bejeweled, Tetris, Starfli...
4 Weird Worlds: Return to Infinite Space 2005-01-01 2014-01-01 Rich Carlson, Iikka Keränen Space science fiction [] [Fallen, 91] [] [Doom, Ripcord, Memento Mori, Inferno, Gods]
5 Spelunky 2009-01-01 2012-01-01 Derek Yu, Andy Hull Fantasy [] [Hack] [Diablo] [Braid, Aquaria, Super Meat Boy, Eternal Daugh...
6 The Binding of Isaac 2011-01-01 NaN Edmund McMillen, Florian Himsl Surrealistic, horror [] [Rogue] [] [Super Meat Boy, The Legend of Zelda, NBA, Gen...
7 FTL: Faster Than Light 2012-01-01 NaN Subset Games Space science fiction [] [Rogue] [The Binding of Isaac, Spelunky, Diablo] [FTL, Federation, Star Wars, Star Trek, Battle...
8 Diablo III 2012-01-01 NaN Blizzard Entertainment Fantasy [] [Sanctuary, Demon, Rogue, 91] [Diablo, Diablo II] [Necromancer, World of Warcraft, Heaven, Basti...
9 Don't Starve 2013-01-01 NaN Klei Entertainment Fantasy [] [] [The Binding of Isaac, Spelunky, Rogue Legacy] [Minecraft, Willow, Hamlet, Switch, Mark of th...

Save the year of publication for each game


In [614]:
ignored = set([
    "Tolkien's Middle-Earth",
    "EmoSquid",
    "Choose",
    "City of the Condemned",
    "Crosswords",
    "Older Console RPG",
    "Dark Hersey",
    "Dungeon Monkey",
    "games from 80's",
    "Rogue Rage",
    "Cellular automata",
    "Deep Realm Heroes",
    "Slimy Lichmummy", # Beta
    "Zap'M",
    "some dungeon crawlers",
    "MathRL",
    "H.P. Lovecraft",
    "Horror movies",
    "Monty Python",
    "1984",
    "Doomsday 2000",
    "UnNetHack", # No release year found
    "d20",
    "interactive fiction",
    "interactive fiction and roguelikes",
    "A DAY @ THE ZOO",
    "Ascii Wilderness", # Not major or stable
    "Demon Tactic", # Alpha
    "Monster Caves", # Unable to verify
    "Gem miner",
    "DDRogue",
    "Rogue Crystal Quest",
    "noir movies",
    "oldschool adventure games",
    "miscellaneous fantasy",
    "the Greek alphabet",
    "SporkHack",
    "Anne McCaffrey's Pern",
    "Pern",
    "SLASH",
    "Half-way",
    "Cataclysm: Dark Days Ahead", # NEED TO BE ADDED TO ROGUETEMPLE
    "CataclysmDDA",
    "Western RPGs",
    "The Dungeon of Doom", 
    "Dragon Ball",
    "Christianity",
    "Hneftafl",
    "PabloQuest",
    "President",
    "Colorado",
    "Kudos",
    "Up",
])

video_games = pd.read_json(os.path.join(os.getcwd(), 'games.json'))
video_game_names = set(x for x in video_games['title'] if isinstance(x, str) and not all(d.isdigit() for d in x))

def get_year(title):
    if title in roguelike_names:
        return int(roguelikes.loc[roguelikes['Name'] == title].iloc[0]['Released'][:4])
    elif title in roguelikelike_names:
        return int(roguelikelikes.loc[roguelikelikes['Name'] == title].iloc[0]['Released'])
    elif title in video_game_names:
        return int(video_games.loc[video_games['title'] == title].iloc[0]['year'])
    elif title in ignored:
        return None # Out of scope
    raise Exception("{} has no release year on file.".format(title))

game_year = {}

for influences in roguelike_universe_data['Influences']:
    for game in influences:
#         print(game)
        year = get_year(game)
        if year:
            game_year[game] = year
for influences in roguelike_universe_data['Inferred_Roguelike_Influences']:
    for game in influences:
        year = get_year(game)
        if year:
            game_year[game] = year
for influences in roguelike_universe_data['Inferred_Roguelikelike_Influences']:
    for game in influences:
        year = get_year(game)
        if year:
            game_year[game] = year
for influences in roguelike_universe_data['Inferred_Other_Influences']:
    for game in influences:
        year = get_year(game)
        if year:
            game_year[game] = year
for game in roguelike_universe_data['Name']:
    year = get_year(game)
    if year:
        game_year[game] = year
        
for influences in roguelikelike_universe_data['Influences']:
    for game in influences:
        year = get_year(game)
        if year:
            game_year[game] = year
for influences in roguelikelike_universe_data['Inferred_Roguelike_Influences']:
    for game in influences:
        year = get_year(game)
        if year:
            game_year[game] = year
for influences in roguelikelike_universe_data['Inferred_Roguelikelike_Influences']:
    for game in influences:
        year = get_year(game)
        if year:
            game_year[game] = year
for influences in roguelikelike_universe_data['Inferred_Other_Influences']:
    for game in influences:
        year = get_year(game)
        if year:
            game_year[game] = year
for game in roguelikelike_universe_data['Name']:
    year = get_year(game)
    if year:
        game_year[game] = year
        
print(len(game_year))


1527

Convert Lists to JSON


In [615]:
import json

def list_to_JSON(xs):
    return [json.dumps(x) for x in xs]

roguelike_universe_data["Influences"] = list_to_JSON(roguelike_universe_data["Influences"])
roguelike_universe_data["Inferred_Roguelike_Influences"] = list_to_JSON(roguelike_universe_data["Inferred_Roguelike_Influences"])
roguelike_universe_data["Inferred_Roguelikelike_Influences"] = list_to_JSON(roguelike_universe_data["Inferred_Roguelikelike_Influences"])
roguelike_universe_data["Inferred_Other_Influences"] = list_to_JSON(roguelike_universe_data["Inferred_Other_Influences"])                           
    
roguelikelike_universe_data["Influences"] = list_to_JSON(roguelikelike_universe_data["Influences"])
roguelikelike_universe_data["Inferred_Roguelike_Influences"] = list_to_JSON(roguelikelike_universe_data["Inferred_Roguelike_Influences"])
roguelikelike_universe_data["Inferred_Roguelikelike_Influences"] = list_to_JSON(roguelikelike_universe_data["Inferred_Roguelikelike_Influences"])
roguelikelike_universe_data["Inferred_Other_Influences"] = list_to_JSON(roguelikelike_universe_data["Inferred_Other_Influences"])

Save contents to file for visualisation


In [616]:
roguelike_universe_data.to_csv('roguelike-influence.csv')
roguelikelike_universe_data.to_csv('roguelikelike-influence.csv')
save_json('games-influence.json', game_year)